<!--
 * @Author: your name
 * @Date: 2021-07-15 11:12:57
 * @LastEditTime: 2021-07-15 23:24:16
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \练习库e:\72-briup\briupteamproj\src\views\Article.vue
-->

<template>
  <div class="wrapper">
    <div class="article">
      <Header></Header>
      <ArticleFrame>
        <div v-html="article.content"></div>
      </ArticleFrame>
      <Footer></Footer>
    </div>
  </div>
</template>

<script>
import ArticleFrame from './components/ArticleFrame.vue'
import Header from './components/Header.vue'
import Footer from './components/Footer.vue'
import { get } from '../utils/request'

export default {
  data() {
    return {
      articleId: 0,
      article: {},
    }
  },
  components: {
    Header,
    ArticleFrame,
    Footer,
  },
  methods: {
    loadArticle() {
      let url = '/index/article/findById'
      get(url, { id: this.articleId }).then((res) => {
        this.article = res.data
      })
    },
  },
  created() {
    this.articleId = this.$route.query.articleId
    this.loadArticle()
  },
}
</script>
<style scoped>
.wrapper {
  width: 65%;
  margin: 0 auto;
}
</style>